/**************************************************************************
 *  创建者：        华磊
 *  开始时间：   2019.05.3
 *  copyright:  (C) 深圳市华友高科有限公司
 *  修改说明：  (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 *
 *
 ***************************************************************************/

#include "axismoveinstructiondelegate.h"
#include "../AxisMoveInstructionView/axismoveinstructionview.h"

AxisMoveInstructionDelegate::AxisMoveInstructionDelegate()
{

}


void AxisMoveInstructionDelegate::initView()
{


}

void AxisMoveInstructionDelegate::finishEditInstructionSlot()
{
    QString tmpPositionReference;
    switch(instructionView->instructionPara.positionReference)
    {
    case E_POSITION_REFERENCE_ABSOLUTE:
    {
        tmpPositionReference="ABSOLUTE";
        break;
    }
    case E_POSITION_REFERENCE_INC:
    {
        tmpPositionReference="INC";
        break;
    }
    case E_POSITION_REFERENCE_FOLLOW:
    {
        tmpPositionReference="FOLLOW";
        break;
    }
    case E_POSITION_REFERENCE_CAR:
    {
        tmpPositionReference="CARREFERENCE";
        break;
    }
    case E_POSITION_REFERENCE_MAP:
    {
        tmpPositionReference="MAPREFERENCE";
        break;
    }
    }
    instructionView->instructionStr = QObject::tr("AXISMOVE AXIS[");
    instructionView->instructionStr +=QString::number(instructionView->instructionPara.axisId)+"] "+
            QString::number(instructionView->instructionPara.velocityRatio)+"% TARGET"+
            QString::number(instructionView->instructionPara.targetPosition)+" "+tmpPositionReference;


    instructionView->instructionStr += QObject::tr(" ;   //") + instructionView->instructionPara.comment;

}

void AxisMoveInstructionDelegate::cleanNoteSlot()
{
    instructionView->instructionPara.comment.clear();
}
